package startupcompanymanager2012.minigames.SlidePuzzle;

// SlidePuzzle.java - Puzzle to slide pieces to correct position.
// Fred Swartz, 2003-May, 2004-May
//   The SlidePuzzle program consists of three files:
//   SlidePuzzle.java      - this file with main to create window.
//   SlidePuzzleGUI.java   - implements the GUI interface.
//   SlidePuzzleModel.java - the logical functioning.
import java.awt.Dimension;
import javax.swing.JFrame;

///////////////////////////////////////////// class SlidePuzzle
public  class SlidePuzzle extends JFrame {

    public static int counter = 0;
    private  static SlidePuzzleGUI sliderGUI;
    public static JFrame window;
    //============================================= method main
    public SlidePuzzle() {
        this.setTitle("Slide Puzzle");
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.setPreferredSize(new Dimension(300,300));
        sliderGUI = new SlidePuzzleGUI();
        sliderGUI.setMaximumSize(new Dimension(350,400));
        sliderGUI.win = false;
        this.setContentPane(sliderGUI);
        this.pack();  // finalize layout
        this.setVisible(true);  // make window visible
        this.setResizable(false);

    }

//    public static void main(String[] args) {
//        window.setTitle("Slide Puzzle");
//        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        sliderGUI = new SlidePuzzleGUI();
//        sliderGUI.win = false;
//        window.setContentPane(sliderGUI);
//        window.pack();  // finalize layout
//        window.show();  // make window visible
//        window.setResizable(false);
//    }//end main

    public  static void checkStatus() {

        if (sliderGUI.win == true) {
            startupcompanymanager2012.StartupCompanyManager2012gameWorker.bonusReady = false;
            startupcompanymanager2012.StartupCompanyManager2012gameWorker.updateStats();
            double bonusFactor = 1.00 + (counter / 1000.00);
            int selected = startupcompanymanager2012.StartupCompanyManager2012gameCreator.gameList.getSelectedIndex();
            startupcompanymanager2012.Core.games.get(selected).bonusFactor = bonusFactor;
            startupcompanymanager2012.Core.games.get(selected).calculateScore();
          

        }
    }
    public void disposeWindow(){
        this.dispose();
        
    }
}//endclass SlidePuzzle